package com.sharedprint.system.organization.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sharedprint.system.organization.mapper.OrganizationMapper;
import com.sharedprint.system.organization.pojo.Organization;
@Service
public class OrganizationServiceImpl implements OrganizationService{

	@Autowired
	OrganizationMapper organizationMapper;
	
	@Override
	public List<Organization> findOrganizationList(Map<String, Object> searchMap) {
		return organizationMapper.selectByMap(searchMap);
	}

	@Override
	public int findCount(Map<String, Object> searchMap) {
		return organizationMapper.selectCount(searchMap);
	}

	@Override
	public int insert(Organization organization) {
		return organizationMapper.insertSelective(organization);
	}

	@Override
	public int delete(Organization organization) {
		return organizationMapper.deleteByPrimaryKey(organization.getOrgId());
	}

	@Override
	public int update(Organization organization) {
		return organizationMapper.updateByPrimaryKeySelective(organization);
	}

	@Override
	public int updateOrgState(Map<String, Object> searchMap) {
		return organizationMapper.updateOrgState(searchMap);
	}

}
